using System;
using System.Collections.Generic;
using System.Text;

namespace CodePlex.OpenSearch
{
    internal class Url
    {
        private string _template;
        private string _type;
        private int _indexOffset;
        private int _pageOffset;

        internal Url()
        {
            _indexOffset = 1;
            _pageOffset = 1;
        }

        internal Url(string type, string template)
            : this()
        {
            _type = type;
            _template = template;
        }

        /// <summary>
        /// Contains the search URL template to be processed according to the OpenSearch URL template syntax.
        /// Requirements: This attribute is required. 
        /// </summary>
        internal string Template
        {
            get
            {
                return _template;
            }
            set
            {
                _template = value;
            }
        }


        /// <summary>
        /// Contains the MIME type of the search result format.
        /// Restrictions: The value must be a valid MIME type. 
        /// Requirements: This attribute is required. 
        /// </summary>
        internal string Type
        {
            get
            {
                return _type;
            }
            set
            {
                _type = value;
            }
        }

        /// <summary>
        /// Contains the index number of the first search result.
        /// Restrictions: The value must be an integer. 
        /// Default: "1" 
        /// Requirements: This attribute is optional. 
        /// </summary>
        internal int IndexOffset
        {
            get
            {
                return _indexOffset;
            }
            set
            {
                _indexOffset = value;
            }
        }


        /// <summary>
        /// Contains the page number of the first set of search results.
        /// Restrictions: The value must be an integer. 
        /// Default: "1". 
        /// Requirements: This attribute is optional. 
        /// </summary>
        internal int PageOffset
        {
            get
            {
                return _pageOffset;
            }
            set
            {
                _pageOffset = value;
            }
        }

    }
}
